export class Item {
    id = 0
    // 名称
    name = ''
    // 堆叠数量
    stack = 100
    // 是否是自然资源
    collect = false
    handCollect = false
    // 相态 固液气
    phase = '固态'
    // 占地面积
    area = 0
    // 大于0 产电 小于0耗电
    energy = 0
    // 热值默认可发电数量
    energyTotal = 0
    // 发电或者耗电系数
    energyRate = 1
}

export let itemData: Array<Item> = []

export let itemMap = new Map<number, Item>()

export let itemIdNameMap = new Map<number, string>()

export let loadItemData = () => {
    for (let i of defaultData) {
        itemData.push(Object.assign(new Item(), i))
    }
    for (let item of itemData) {
        itemMap.set(item.id, item)
        itemIdNameMap.set(item.id, item.name)
    }
}

let defaultData: Array<any> = [
    {
        "collect": true,
        "handCollect": true,
        "id": 1001,
        "name": "铁矿"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1002,
        "name": "铜矿"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1003,
        "name": "硅石"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1004,
        "name": "钛石"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1005,
        "name": "石矿"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1006,
        "name": "煤矿"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1011,
        "name": "可燃冰"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1012,
        "name": "金伯利矿石"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1013,
        "name": "分形硅石"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1014,
        "name": "光栅石"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1015,
        "name": "刺笋结晶"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1016,
        "name": "单极磁石"
    },
    {
        "id": 1101,
        "name": "铁块"
    },
    {
        "id": 1102,
        "name": "磁铁"
    },
    {
        "id": 1103,
        "name": "钢材"
    },
    {
        "id": 1104,
        "name": "铜块"
    },
    {
        "id": 1105,
        "name": "高纯硅块"
    },
    {
        "id": 1106,
        "name": "钛块"
    },
    {
        "id": 1107,
        "name": "钛合金"
    },
    {
        "id": 1108,
        "name": "石材"
    },
    {
        "id": 1109,
        "name": "高能石墨"
    },
    {
        "id": 1110,
        "name": "玻璃"
    },
    {
        "id": 1119,
        "name": "钛化玻璃"
    },
    {
        "id": 1111,
        "name": "棱镜"
    },
    {
        "id": 1112,
        "name": "金刚石"
    },
    {
        "id": 1113,
        "name": "晶格硅"
    },
    {
        "id": 1201,
        "name": "齿轮"
    },
    {
        "id": 1202,
        "name": "磁线圈"
    },
    {
        "id": 1203,
        "name": "电动机"
    },
    {
        "id": 1204,
        "name": "电磁涡轮"
    },
    {
        "id": 1205,
        "name": "超级磁场环"
    },
    {
        "id": 1206,
        "name": "粒子容器"
    },
    {
        "id": 1127,
        "name": "奇异物质"
    },
    {
        "id": 1301,
        "name": "电路板"
    },
    {
        "id": 1303,
        "name": "处理器"
    },
    {
        "id": 1305,
        "name": "量子芯片"
    },
    {
        "id": 1302,
        "name": "微晶元件"
    },
    {
        "id": 1304,
        "name": "位面过滤器"
    },
    {
        "id": 1402,
        "name": "粒子宽带"
    },
    {
        "id": 1401,
        "name": "电浆激发器"
    },
    {
        "id": 1404,
        "name": "光子合并器"
    },
    {
        "id": 1501,
        "name": "太阳帆"
    },
    {
        "collect": true,
        "id": 1000,
        "name": "水",
        "phase": "液体",
        "stack": 20
    },
    {
        "collect": true,
        "id": 1007,
        "name": "原油",
        "phase": "液体",
        "stack": 20
    },
    {
        "id": 1114,
        "name": "精炼油",
        "phase": "液体",
        "stack": 20
    },
    {
        "collect": true,
        "id": 1116,
        "name": "硫酸",
        "phase": "液体",
        "stack": 20
    },
    {
        "collect": true,
        "id": 1120,
        "name": "氢",
        "phase": "气体",
        "stack": 20
    },
    {
        "collect": true,
        "id": 1121,
        "name": "重氢",
        "phase": "气体",
        "stack": 20
    },
    {
        "id": 1122,
        "name": "反物质"
    },
    {
        "id": 1208,
        "name": "临界光子"
    },
    {
        "id": 1801,
        "name": "液氢燃料棒",
        "stack": 30
    },
    {
        "id": 1802,
        "name": "氘核燃料棒",
        "stack": 30
    },
    {
        "id": 1803,
        "name": "反物质燃料棒",
        "stack": 30
    },
    {
        "id": 1115,
        "name": "塑料"
    },
    {
        "id": 1123,
        "name": "石墨烯"
    },
    {
        "id": 1124,
        "name": "碳纳米管"
    },
    {
        "collect": true,
        "handCollect": true,
        "id": 1117,
        "name": "有机晶体"
    },
    {
        "id": 1118,
        "name": "钛晶石"
    },
    {
        "id": 1126,
        "name": "卡西米尔晶体"
    },
    {
        "id": 1209,
        "name": "引力透镜"
    },
    {
        "id": 1210,
        "name": "空间翘曲器"
    },
    {
        "id": 1403,
        "name": "湮灭约束球"
    },
    {
        "id": 1405,
        "name": "推进器"
    },
    {
        "id": 1406,
        "name": "加力推进器"
    },
    {
        "id": 5001,
        "name": "物流运输机"
    },
    {
        "id": 5002,
        "name": "星际物流运输船"
    },
    {
        "id": 1125,
        "name": "框架材料"
    },
    {
        "id": 1502,
        "name": "戴森球组件"
    },
    {
        "id": 1503,
        "name": "小型运载火箭"
    },
    {
        "id": 1131,
        "name": "地基"
    },
    {
        "id": 1141,
        "name": "加速剂Mk.I",
        "phase": "液体",
        "stack": 20
    },
    {
        "id": 1142,
        "name": "加速剂Mk.II",
        "phase": "液体",
        "stack": 20
    },
    {
        "id": 1143,
        "name": "加速剂Mk.III",
        "phase": "液体",
        "stack": 20
    },
    {
        "area": 1,
        "id": 2001,
        "name": "传送带",
        "stack": 50
    },
    {
        "area": 1,
        "id": 2002,
        "name": "高速传送带",
        "stack": 50
    },
    {
        "area": 1,
        "id": 2003,
        "name": "极速传送带",
        "stack": 50
    },
    {
        "id": 2011,
        "name": "分拣器",
        "stack": 50
    },
    {
        "id": 2012,
        "name": "高速分拣器",
        "stack": 50
    },
    {
        "id": 2013,
        "name": "极速分拣器",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2020,
        "name": "四向分流器",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2101,
        "name": "小型储物仓",
        "stack": 50
    },
    {
        "area": 15,
        "id": 2102,
        "name": "大型储物仓",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2106,
        "name": "储液罐",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2303,
        "name": "制造台Mk.I",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2304,
        "name": "制造台Mk.II",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2305,
        "name": "制造台Mk.III",
        "stack": 50
    },
    {
        "area": 1,
        "id": 2201,
        "name": "电力感应塔",
        "stack": 50
    },
    {
        "area": 1,
        "id": 2202,
        "name": "无线输电塔",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2212,
        "name": "卫星配电站",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2203,
        "name": "风力涡轮机",
        "stack": 50,
        "energy": 300
    },
    {
        "area": 24,
        "id": 2204,
        "name": "火力发电厂",
        "stack": 50
    },
    {
        "area": 24,
        "id": 2211,
        "name": "微型聚变发电站",
        "stack": 50
    },
    {
        "area": 20,
        "id": 2301,
        "name": "采矿机",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2302,
        "name": "电弧熔炉",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2315,
        "name": "位面熔炉",
        "stack": 50
    },
    {
        "area": 35,
        "id": 2307,
        "name": "原油萃取站",
        "stack": 50
    },
    {
        "area": 18,
        "id": 2308,
        "name": "原油精炼厂",
        "stack": 50
    },
    {
        "area": 15,
        "id": 2306,
        "name": "抽水站",
        "stack": 50
    },
    {
        "area": 24,
        "id": 2309,
        "name": "化工厂",
        "stack": 50
    },
    {
        "area": 25,
        "id": 2314,
        "name": "分馏塔",
        "stack": 50
    },
    {
        "id": 2313,
        "name": "喷涂机",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2205,
        "name": "太阳能板",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2206,
        "name": "蓄电器",
        "stack": 50
    },
    {
        "area": 9,
        "id": 2207,
        "name": "蓄电器（满）",
        "stack": 50
    },
    {
        "area": 25,
        "id": 2311,
        "name": "电磁轨道弹射器",
        "stack": 50
    },
    {
        "area": 25,
        "id": 2208,
        "name": "射线接收站",
        "stack": 50
    },
    {
        "area": 49,
        "id": 2312,
        "name": "垂直发射井",
        "stack": 50
    },
    {
        "area": 25,
        "id": 2209,
        "name": "能量枢纽",
        "stack": 50
    },
    {
        "area": 35,
        "id": 2310,
        "name": "微型粒子对撞机",
        "stack": 50
    },
    {
        "area": 25,
        "id": 2210,
        "name": "人造恒星",
        "stack": 50
    },
    {
        "area": 25,
        "id": 2103,
        "name": "行星内物流运输站",
        "stack": 50
    },
    {
        "area": 25,
        "id": 2104,
        "name": "星际物流运输站",
        "stack": 50
    },
    {
        "id": 2105,
        "name": "轨道采集器",
        "stack": 50
    },
    {
        "area": 25,
        "id": 2901,
        "name": "矩阵研究站",
        "stack": 50
    },
    {
        "id": 6001,
        "name": "电磁矩阵",
        "stack": 50
    },
    {
        "id": 6002,
        "name": "能量矩阵",
        "stack": 50
    },
    {
        "id": 6003,
        "name": "结构矩阵",
        "stack": 50
    },
    {
        "id": 6004,
        "name": "信息矩阵",
        "stack": 50
    },
    {
        "id": 6005,
        "name": "引力矩阵",
        "stack": 50
    },
    {
        "id": 6006,
        "name": "宇宙矩阵",
        "stack": 50
    }
]